import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter) // 全局注册声明
    // 1. 定义路由组件
    // @ is alias src 
import Home from '@/views/Home.vue'
import Find from '@/views/Find.vue'
import Mine from '@/views/Mine.vue'
import Ajax from '@/views/Ajax.vue'
import Axios from '@/views/Axios.vue'
//定义路由配置选项
const routes = [{
        path: "/",
        redirect: { name: "home" }
    }, {
        path: "/home",
        name: 'home',
        component: Home
    }, {
        path: "/find",
        name: 'find',
        component: Find
    }, {
        path: "/mine",
        name: 'mine',
        component: Mine
    }, {
        path: "/ajax",
        name: 'ajax',
        component: Ajax
    }, {
        path: "/axios",
        name: 'axios',
        component: Axios
    }, ]
    //  创建路由对象 
const router = new VueRouter({
    mode: "history",
    routes,
})
export default router